import { defHttp } from '@/utils/http/axios';
import { DataItem, GetDataListParams, GetMeDataListParams } from './model/datacenter';
import { BasicFetchResult } from '@/api/model/baseModel'
import { ErrorMessageMode } from '#/axios';

export function getDataList(params: GetDataListParams, mode: ErrorMessageMode = 'message') {
  return defHttp.get<BasicFetchResult<DataItem>>(
    {
      url: '/datacenter/data',
      params,
    },
    {
      errorMessageMode: mode
    }
  );
}

export function getMeDataList(params: GetMeDataListParams, mode: ErrorMessageMode = 'message') {
  return defHttp.get<BasicFetchResult<DataItem>>(
    {
      url: '/datacenter/data/me',
      params,
    },
    {
      errorMessageMode: mode
    }
  );
}
